<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateYsBarTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('bar', function(Blueprint $table)
		{
			$table->increments('id')->comment('主键id');
			$table->string('bar_num', 32)->nullable()->index('bar_bar_num_index')->comment('吧编号');
			$table->string('title')->comment('吧标题');
			$table->bigInteger('uid')->nullable()->comment('关联用户id');
			$table->integer('last_editdate')->nullable()->comment('最后编辑时间');
			$table->boolean('grade')->nullable()->default(0)->comment('吧等级');
			$table->string('bar_cover')->comment('贴吧封面');
			$table->string('bar_excerpt', 256)->comment('贴吧摘要');
			$table->integer('create_time')->comment('创建时间');
			$table->boolean('status')->nullable()->default(0)->comment('吧状态0为正常');
			$table->boolean('recommend')->nullable()->default(0)->comment('推荐0为正常1为推荐');
			$table->boolean('type')->nullable()->default(0)->comment('0为作者吧1为官方吧2为意见反馈吧');
			$table->string('background')->nullable()->comment('背景');
			$table->softDeletes();
			$table->timestamps();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('bar');
	}

}
